//
//  CCCollectionAdapter.h
//  CKApp
//
//  Created by CC on 2020/9/8.
//  Copyright © 2020 This Moment. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@class CCCollectionViewCellData;
@class CCCollectionViewCell;

@interface CCCollectionAdapter : NSObject
@property(nonatomic, weak) UICollectionView* collectionView;
@property(nonatomic, strong) NSMutableArray<NSArray<CCCollectionViewCellData*>*>* cellDatas;
// up<->down spacing for vertical, left<->right for horizontal
@property(nonatomic, strong) NSArray<NSNumber*>* minimumLineSpacing;
// left<->right spacing for vertical, up<->down for horizontal
@property(nonatomic, strong) NSArray<NSNumber*>* minimumInteritemSpacing;
@property(nonatomic, strong) NSArray<NSValue*>* headerReferenceSize;
@property(nonatomic, strong) NSArray<NSValue*>* footerReferenceSize;
@property(nonatomic, strong) NSArray<NSValue*>* sectionInsets;

- (void)registerCollectionView:(UICollectionView*)collectionView scrollDirection:(UICollectionViewScrollDirection)scrollDirection;

- (void)autoRegisterCellByCellData:(UICollectionView*)collectionView;

- (void)removeAllCellDatas;
- (void)refreshAllCells;
- (void)refreshCellData:(CCCollectionViewCellData*)cellData section:(NSInteger)section;

- (CCCollectionViewCell*)cellWithCellData:(CCCollectionViewCellData*)cellData
                                  section:(NSInteger)section;
- (CCCollectionViewCellData*)cellData:(NSIndexPath*)indexPath;
@end
